using Assets.Scripts.GDK;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace Brick
{
	public class WordInfoAlertItem : gdk_base_UI
	{
		public Text keyText;

		public RectTransform infoContent;

		public Text infoText;

		public void OnData(WordInfoItemModel wordInfoItemModel)
		{
			gdk_utils.removeAllChildren(infoContent);
			keyText.text = wordInfoItemModel.key;
			List<WordInfoItemValueModel> value = wordInfoItemModel.value;
			for (int i = 0; i < value.Count; i++)
			{
				WordInfoItemValueModel wordInfoItemValueModel = value[i];
				Text text = Object.Instantiate(infoText);
				text.text = string.Empty + (i + 1).ToString() + "  (" + wordInfoItemValueModel.type + ") " + wordInfoItemValueModel.str;
				RectTransform component = text.GetComponent<RectTransform>();
				component.gameObject.SetActive(value: true);
				component.SetParent(infoContent, worldPositionStays: false);
			}
		}
	}
}

